package com.ccp.dev.workflow.model;


import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * 对象功能:流程定义节点sql设置
 * @author jiayueqiao
 */
public class BpmNodeSql extends BaseModel<BpmNodeSql> {
	/**
	 * 保存
	 */
	public static String ACTION_SAVE="save";
	/**
	 * 提交	
	 */
	public static String ACTION_SUBMIT="submit";
	/**
	 * 同意
	 */
	public static String ACTION_AGREE="agree";
	/**
	 * 反对
	 */
	public static String ACTION_OPPOSITE="opposite";
	/**
	 * 驳回
	 */
	public static String ACTION_REJECT="reject";
	/**
	 * 删除
	 */
	public static String ACTION_DELETE="delete";
	/**
	 * 结束
	 */
	public static String ACTION_END="end";

	/**
	 * 主键id
	 */
	private String id;
	/**
	 * 名称
	 */
	private String name;
	/**
	 * 数据源别名
	 */
	private String dsAlias;
	/**
	 * 流程定义id
	 */
	private String procDefId;
	/**
	 * 节点ID
	 */
	private String nodeId;
	/**
	 * 触发时机
	 */
	private String action;
	/**
	 * SQL语句
	 */
	private String sql;
	/**
	 * 描述
	 */
	private String desc;

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 返回 ID
	 * 
	 * @return
	 */
	public String getId() {
		return this.id;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 返回 NAME
	 * 
	 * @return
	 */
	public String getName() {
		return this.name;
	}

	public void setAction(String action) {
		this.action = action;
	}

	/**
	 * 返回 触发时机
	 * 
	 * @return
	 */
	public String getAction() {
		return this.action;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}

	/**
	 * 返回 SQL语句
	 * 
	 * @return
	 */
	public String getSql() {
		return this.sql;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	/**
	 * 返回 描叙
	 * 
	 * @return
	 */
	public String getDesc() {
		return this.desc;
	}

	/**
	 * dsAlias
	 * @return  the dsAlias
	 * @since   1.0.0
	 */
	
	public String getDsAlias() {
		return dsAlias;
	}

	/**
	 * @param dsAlias the dsAlias to set
	 */
	public void setDsAlias(String dsAlias) {
		this.dsAlias = dsAlias;
	}

	/**
	 * procDefId
	 * @return  the procDefId
	 * @since   1.0.0
	 */
	
	public String getProcDefId() {
		return procDefId;
	}

	/**
	 * @param procDefId
	 */
	public void setProcDefId(String procDefId) {
		this.procDefId = procDefId;
	}

	/**
	 * nodeId
	 * @return  the nodeId
	 * @since   1.0.0
	 */
	
	public String getNodeId() {
		return nodeId;
	}

	/**
	 * @param nodeId the nodeId to set
	 */
	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	/**
	 * @see Object#equals(Object)
	 */
	@Override
	public boolean equals(Object object) {
		if (!(object instanceof BpmNodeSql)) {
			return false;
		}
		BpmNodeSql rhs = (BpmNodeSql) object;
		return new EqualsBuilder().append(this.id, rhs.id).append(this.name, rhs.name).append(this.dsAlias, rhs.dsAlias).append(this.procDefId, rhs.procDefId).append(this.nodeId, rhs.nodeId).append(this.action, rhs.action).append(this.sql, rhs.sql).append(this.desc, rhs.desc).isEquals();
	}

	/**
	 * @see Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973).append(this.id).append(this.name).append(this.dsAlias).append(this.procDefId).append(this.nodeId).append(this.action).append(this.sql).append(this.desc).toHashCode();
	}

	/**
	 * @see Object#toString()
	 */
	@Override
	public String toString() {
		return new ToStringBuilder(this).append("id", this.id).append("name", this.name).append("dsAlias", this.dsAlias).append("procDefId", this.procDefId).append("nodeId", this.nodeId).append("action", this.action).append("sql", this.sql).append("desc", this.desc).toString();
	}

}